const Koa = require('koa')


// 实例化应用
const app = new Koa()

// 中间件
app.use(async (ctx) => {
    ctx.set('x-version', '1.0.0')
    ctx.body = {
        methods: ctx.method,
        path: ctx.path,
        query: ctx.query,
        headers: ctx.headers,
        ip: ctx.ip
    }
})

app.listen(8899, () => {
    console.log('listen on 8899');
})